package REDES2;

import java.awt.Component;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

public class Convite {
	
	public static String convite(Component c, String nome){
		ImageIcon  i = testeicon.createImageIcon("invite.jpg");
		int accept = JOptionPane.showConfirmDialog(c,
				"Jogar com "+nome+" ?", "Convite", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, i);
		if (accept == JOptionPane.YES_OPTION)
			return("c,aceitou");
		else 
			return("c,recusou");
	}
	public static void recusou(Component c){
		ImageIcon  i = testeicon.createImageIcon("/imgs/handdown.jpg");
		JOptionPane.showMessageDialog(c, "Recusou", "Convite recusado", JOptionPane.WARNING_MESSAGE, i);
	}
	public static String time(Component c){
		ImageIcon  i = testeicon.createImageIcon("invite.jpg");
		int accept = JOptionPane.showConfirmDialog(c,
				"Deseja advinhar as cores ?", "Time", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, i);
		if (accept == JOptionPane.YES_OPTION)
			return("<y>");
		else 
			return("n");
	}
}
